const foo: any = 'bar';
foo !== undefined && foo !== null ? foo : 'a string';
foo === undefined || foo === null ? 'a string' : foo;
foo == undefined ? 'a string' : foo;
foo == null ? 'a string' : foo;

const foo2: string | undefined = 'bar';
foo2 !== undefined ? foo2 : 'a string';
foo2 === undefined ? 'a string' : foo2;

const foo3: string | null = 'bar';
foo3 !== null ? foo3 : 'a string';
foo3 === null ? 'a string' : foo3;
